package com.yazi.mxz.gather.dao.impl;

import org.hibernate.Criteria;
import org.hibernate.criterion.Example;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;



import com.myframework.smhj.hibernate.Page;
import com.myframework.smhj.hibernate.Searching;
import com.myframework.smhj.hibernate.dao.BasicDao;
import com.yazi.mxz.gather.dao.RegionDao;
import com.yazi.mxz.gather.entity.beans.Region;

/**
 * 
 * @author mo_yq5
 * @date 2015-9-8
 */
@Repository("regionDao")
public class RegionDaoImpl extends BasicDao<Region> implements RegionDao {


	public RegionDaoImpl() {
		super(Region.class);
	}

	@Override
	public Criteria getExample(Region region, String searchWord) {
		Criteria c = createCriteria(Region.class);
		
		Example example = Example.create(region);
		c.add(example);
		
		
		return c;
	}
	
	@Override
	public Page<Region> listGtUpdateTime(long updateTime, Searching si) {
		Criteria c = createCriteria(Region.class);
		c.add(Restrictions.gt("updateTime", updateTime));
		return list(c, si);
	}

}
